//
//  YYLControlController.m
//  YYLSport
//
//  Created by yangyinglei on 2017/4/21.
//  Copyright © 2017年 yangyinglei. All rights reserved.
//

#import "YYLControlController.h"
#import "YYLMapViewController.h"
#import "YYLTrackViewController.h"

@interface YYLControlController ()

@property (weak, nonatomic) IBOutlet UIView *trackView;
@property (nonatomic, strong) YYLTrackViewController *trackVc;

@end

@implementation YYLControlController

- (void)viewDidLoad {
    [super viewDidLoad];

    //在此创建轨迹控制器 为的是延长trackVc的生命周期 
    self.trackVc = [[YYLTrackViewController alloc] init];
    _trackVc.track = _track;
    
}

- (IBAction)changeSportState:(UIButton *)sender {
    //改变运动状态
    self.track.sportState = sender.tag;
    
}

- (IBAction)showMapAction:(UIButton *)sender {

    [self presentViewController:self.trackVc animated:YES completion:^{
        
    }];
}

- (void)setTrack:(YYLSportTrack *)track {

    _track = track;
}
@end
